mod worker;
mod fs;
mod log_core;
mod service;
mod channel;
mod runtime;

pub use worker::{Worker, Handler, Message, WorkerSender, WorkerContextImpl, Running};
pub use fs::{create_file, create_file_with_content, modify_file_by_name, read_file, is_file, delete_file};
pub use service::service_send_msg;
pub use runtime::run;
pub use the_world_game_rt::main as main;
pub use the_world_game_rt::test as test;

use std::future::Future;

pub fn spawn<T>(task: T)
    where
        T: Future + Send + 'static,
        T::Output: Send + 'static,
{
    tokio::spawn(task);
}


pub mod log {
    pub use crate::log_core::{new, trace, debug, info, warn, error};
}

pub mod serialization {
    pub use serde_json::to_string;
    pub use serde_json::from_str;
    pub use serde::Serialize;
    pub use serde::Deserialize;
}

// tokio包装
pub use tokio::time as time;
pub use tokio::signal as signal;

// Result包装
pub mod result {
    pub use anyhow::Result;
    pub use anyhow::anyhow;
    pub use anyhow::Context;
}



